package com.rd.student.jike.class1.guojiabao.Day0801;

import java.util.Arrays;

public class Text01 {
    public static void main(String[] args) {
        int[] arr ={60,77,33,55,88,90,99};
        selectSort(arr);
        System.out.println(Arrays.toString(arr));

    }
    public static void selectSort(int[] arr){
        for (int n = 0;n<arr.length;n++) {
            int min = n;
            for (int i = n+1; i < arr.length; i++) {
                if(arr[i]<arr[min]){
                    min = i;
                }

            }
            if(min == n){
                break;
            }
            int count = 0;
            count = arr[n];
            arr[n] = arr[min];
            arr[min] = count;
            System.out.println(Arrays.toString(arr));
        }

    }
}
